package cn.wolfcode.mq;

import cn.wolfcode.web.controller.OrderInfoController;
import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.annotation.MessageModel;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

/**
 * 修改本地标识消费者
 */
@Slf4j
@Component
@RocketMQMessageListener(
        consumerGroup = "MQOrderCancelLocalSignMQListener",
        topic = MQConstant.CANCEL_SECKILL_OVER_SIGE_TOPIC,
        messageModel = MessageModel.BROADCASTING
)
public class MQOrderCancelLocalSignListener implements RocketMQListener<Long> {

    @Override
    public void onMessage(Long seckillId) {
        log.info("进入修改本地标识消费者");
        //修改本地标识
        OrderInfoController.map.put(seckillId,false);
    }
}
